package com.feng.boot.mybatis.controller;

import com.feng.boot.mybatis.bean.Employee;
import com.feng.boot.mybatis.mapper.EmployeeMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Lee
 */
@RestController
public class EmployeeController {

    @Autowired
    private EmployeeMapper employeeMapper;

    @GetMapping("/getEmployeeById")
    public Employee getEmployeeById(Integer id){
        return employeeMapper.getEmployeeById(id);
    }

    @GetMapping("/saveEmployee")
    public Employee saveEmployee(Employee employee){
        return  employeeMapper.saveEmployee(employee);
    }

}
